package lua.compiler;
import java.util.LinkedList;
import java.util.List;

public class Functions {
	static List<Function> functions = new LinkedList<Function>();

	public static List<Function> getFunctions() {
		return functions;
	}

	public static void addFunction(Function function) {
		functions.add(function);
	}
	
	public static Function getFunction(String name) {
		for (int i = 0; i < functions.size(); i++) {
			Function function = functions.get(i);
			
			if (function.getName().equals(name)) {
				return functions.get(i);
			}
		}
		
		return null;
	}
}
